package com.yx;

import com.yx.service.init.InitSysMenu;
import com.yx.service.init.InitSysPermissionAndRole;
import com.yx.service.init.InitSysUser;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;


@MapperScan("com.yx.mapper")
@Slf4j
@EnableScheduling
@SpringBootApplication
@EnableAspectJAutoProxy(exposeProxy = true)
// war 包必须写 ServletComponentScan
@ServletComponentScan
public class DemoApplication{

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }


    /**
     * 系统初始化
     */
    @Autowired
    private InitSysPermissionAndRole initSysPermissionAndRole;

    /**
     * 初始化系统用户
     */
    @Autowired
    private InitSysUser initSysUser;

    /**
     * 初始化系统菜单
     */
    @Autowired
    private InitSysMenu initSysMenu;

   /* *//**
     * 系统初始化初始化方法
     * @param args
     * @throws Exception
     *//*
    @Override
    public void run(String... args) throws Exception {
        // 初始化权限和角色
        initSysPermissionAndRole.init();
        Thread.sleep(5000);
        // 初始化系统用户
        initSysUser.init();
        Thread.sleep(5000);
        // 初始化系统菜单
        initSysMenu.init();
    }*/
}
